﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />

    <title>登录</title>

    <style>
		html, body, .container { height: 100%; overflow: hidden !important; margin: 0 0 0 0; }
		.container { display: table; width: 100% }
			.container > div { text-align: center; display: table-cell; vertical-align: middle; width: 100% }
				.container > div > div { display: inline-block; border: solid 1px skyblue; padding: 10px 10px 10px 10px }
		input { margin-bottom: 5px }
    </style>

    <script src="/web/js/jquery.351.min.js"></script>
    <script src="/web/js/common.js"></script>
    <script src="/web/js/upload.js"></script>

    <script>
        $(async () =>
        {
            await request("清空登录状态", "login.ashx?cmd=clear");
            clearCookie();
            sessionStorage.clear();
        });

        async function login()
        {
            if (/wechat/gi.test(navigator.userAgent))
            {
                alert("不支持在微信内直接打开此网站");
                return;
			}

            var acc = $("#txtAcc").val().trim(), psw = $("#txtPsw").val();

            if (acc == "")
            {
                alert("帐号不能为空或全空格");
                return;
            }

			clearCookie();

			var form = new FormData();
            form.append("acc", encodeURI(acc));
            form.append("psw", psw);
            await request("登录", "login.ashx?cmd=login", true, { method: "POST", body: form });

            sessionStorage.clear();
            location.href = isMobile() ? "mlist.htm" : "list.htm";
        }
    </script>
</head>
<body>
    <div class="container">
        <div>
            <div onkeydown="if(event.keyCode==13) login()">
                <div><span>账号：</span><input id="txtAcc" /></div>
                <div><span>密码：</span><input id="txtPsw" type="password" /></div>
                <div>
                    <button onclick="login()">登录</button>
                </div>
            </div>
			<p>本网站已经在国家工信部网站备案，备案号：<a href="https://beian.miit.gov.cn/" title="国家工信部网站" target="_blank">粤ICP备15067462号</a></p>
        </div>
    </div>
</body>
</html>
